/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data;

import connect.Type;
import diagram.Node;
import diagram.handles.TriggerHandle;
import diagram.handles.InputHandle;
import diagram.handles.ResizeHandle;
import diagram.locations.AbsoluteLocation;
import java.awt.BasicStroke;
import java.awt.Stroke;
import java.io.Serializable;

/**
 *
 * @author Jelle
 */
public class PredefinedObjects implements Serializable  {

    /**
     * @return the basicStroke
     */
    public static Stroke getBasicStroke() {
        return basicStroke;
    }

    private Node simpleNode; // simplevalue node
    private Node n2;
    private TriggerHandle triggerHandle;
    private ResizeHandle resizeHandle;
    private InputHandle inputHandle;
    private static Stroke dashedStroke = new BasicStroke(1.0f, // Width
            BasicStroke.CAP_SQUARE, // End cap
            BasicStroke.JOIN_MITER, // Join style
            10.0f, // Miter limit
            new float[]{2.0f, 5.0f}, // Dash pattern
            0.0f);
    private static Stroke basicStroke = new BasicStroke(1.0f);
    private int InputHandleX=30;
    private int InputHandleY=15;
    private int ResizeHandleX=30;
    private int ResizeHandleY=15;
    private int TriggerHandleR=3;

    public PredefinedObjects() {
        Type intType = new Type("int", "java.lang.Integer");
        simpleNode = new Node("x", "SimpleValue", intType, new AbsoluteLocation(300, 100));
        n2 = new Node("", "+1", intType, new AbsoluteLocation(200, 300));
        triggerHandle = new TriggerHandle();
                //new TriggerHandle(new RectangleLineLocation(new FlexibleRelativeLocation(simpleNode.getUpperLeft(), 0, 0), simpleNode.getUpperLeft(), simpleNode.getLowerRight()), 2);
        resizeHandle = new ResizeHandle();
        inputHandle = new InputHandle();
    }

    /**
     * @return the simpleNode
     */
    public Node getSimpleNode() {
        return simpleNode;
    }

    /**
     * @param simpleNode the simpleNode to set
     */
    public void setSimpleNode(Node simpleNode) {
        this.simpleNode = simpleNode;
    }

    /**
     * @return the circleHandle
     */
    public TriggerHandle getTriggerHandle() {
        return triggerHandle;
    }

    /**
     * @param circleHandle the circleHandle to set
     */
    public void setTriggerHandleBaseNode(Node baseNode) {
        triggerHandle.attach(baseNode);
    }

    /**
     * @return the resizeHandle
     */
    public ResizeHandle getResizeHandle(Node baseNode) {
        resizeHandle.setBaseNode(baseNode);
        //resizeHandle.setMinSize(2);
        return resizeHandle;
    }

       /**
     * @return the dashedStroke
     */
    public static Stroke getDashedStroke() {
        return dashedStroke;
    }

    /**
     * @param aDashedStroke the dashedStroke to set
     */
    public static void setDashedStroke(Stroke aDashedStroke) {
        dashedStroke = aDashedStroke;
    }

    /**
     * @return the inputHandle
     */
    public InputHandle getInputHandle() {
        return inputHandle;
    }

    /**
     * @return the InputHandleX
     */
    public int getInputHandleX() {
        return InputHandleX;
    }

    /**
     * @return the InputHandleY
     */
    public int getInputHandleY() {
        return InputHandleY;
    }

    /**
     * @return the ResizeHandleX
     */
    public int getResizeHandleX() {
        return ResizeHandleX;
    }

    /**
     * @return the ResizeHandleY
     */
    public int getResizeHandleY() {
        return ResizeHandleY;
    }

    /**
     * @return the TriggerHandleR
     */
    public int getTriggerHandleR() {
        return TriggerHandleR;
    }

//    /**
//     * @param resizeHandle the resizeHandle to set
//     */
//    public void setResizeHandle(ResizeHandle resizeHandle) {
//        this.resizeHandle = resizeHandle;
//    }
}
